package structure.composite.security;

public class Demo {
    public static void main(String[] args) {
        Armys soldiers = new Soldiers();
        // 增加步兵
        Armys infantry = new Infantry();
        // 增加骑兵
        Armys cavalry = new cavalry();
        soldiers.add(infantry);
        soldiers.add(cavalry);
        soldiers.display();

    }

}
